Skip to main content

All Questions

0votes
1answer
2kviews

Searching into a contact list

I am performing search in a contact list using linear search with complexity \$O(n)\$. Please suggest me how to improve search strategy in my code. ...
ManojP's user avatar
5votes
2answers
27kviews

Custom sorting of dates

I have implemented a class which implements a list of my custom DateObj. I have sorted the list in a peculiar manner based on the current month. I achieved my ...
digzou's user avatar
5votes
1answer
2kviews

Union of intervals

I am trying to solve for the problem with a bunch of intervals: (1,2),(2,5),(4,7),(9,11) I find their union, which in the above given case would be: ...
sc_ray's user avatar
  • 1,213
8votes
2answers
11kviews

Subsorting with multiple Comparators

I've seen a number of questions on Stack Overflow of the kind of "How do I sort on fields X AND Y?" The most common answers to those questions consists of "Write a custom Comparator." But what if you ...
ThisIsNoZaku's user avatar
11votes
2answers
5kviews

Efficient way of sorting a List based on multiple properties using Google Guava

I'm using Google Guava 17.0 library. I have a class named AroundBust containing only two properties id of type ...
Tiny's user avatar
  • 317
10votes
3answers
8kviews

Sorting numbers using Java Collections.sort()

Input is a file containing numbers in this format: 1.2 3 5.1 2 7 4 6 5 2 9.22 1 0.0 4 3 I am doing the sorting in the simplest way, using ...
w_ahmed's user avatar
1vote
1answer
328views

Displaying plotted data in serpentine order

I have to display some set of: Data in serpentine order. In an experiment there are replication, range, and plot. Replications contains range a plot. A range contains a plot. If there are 2 ...
VIckyb's user avatar

close